/*
 * @Author: 1243sd 782012816@qq.com
 * @Date: 2024-03-22 21:48:40
 * @LastEditors: 1243sd 782012816@qq.com
 * @LastEditTime: 2024-06-23 21:55:55
 * @FilePath: \frontend-ykt-admin\src\api\requestApi\installment.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import _axios from '../axios';

// 扣款列表
const installment = {
	// 分期还款计划列表
	installmentList(data) {
    return _axios({
      method: "post",
      url: `api/installment_plan/page_list`,
      data
    });
  },
  // 分期还款计划详情
  installmentDetail(id) {
    return _axios({
      method: "get",
      url: `api/installment_plan/${id}`,
    });
  },
  // 手动扣款
  handlePay(id) {
    return _axios({
      method: "post",
      url: `api/installment_pay_item/${id}/pay`,
    });
  },
	// 分期还款 - 导出
	installment_export(data) {
		return _axios({
		  method: "post",
		  url: `api/export/installment`,
		  data,
      isBlob: true,
      filename: '分期还款导出列表'
		});
	},

  // 更新医生 
	installmentUpdoctor(data) {
		return _axios({
		  method: "put",
		  url: `api/installment_plan/${data.id}/up_doctor`,
		  data,
		});
	},
  // 更新咨询师 
	installmentUpconsultants(data) {
		return _axios({
		  method: "put",
		  url: `api/installment_plan/${data.id}/up_consultants`,
		  data,
		});
	},
  // 工厂备注 
	installmentMark(data) {
		return _axios({
		  method: "put",
		  url: `api/installment_plan/${data.id}/up_notes`,
		  data,
		});
	},

  // 获取附件列表 
	installmentGetAttr(planId) {
		return _axios({
		  method: "get",
		  url: `api/installment_plan_attachement/${planId}/plan_attr`,
		});
	},
  // 保存附件 
	installmentSaveAttr(data) {
		return _axios({
		  method: "post",
		  url: `api/installment_plan_attachement`,
      data
		});
	},
	// 删除附件 
	installmentDelAttr(id) {
		return _axios({
		method: "delete",
		url: `api/installment_plan_attachement/${id}`,
		});
	},
	// 作废分期计划 
	installment_invalid(id) {
		return _axios({
			method: "put",
			url: `api/installment_plan/${id}/invalid`,
		});
	},
	
	
}
export default installment